README

This folder contains everything necessary to reproduce the results in �FDI and Entrepreneurship: A Meta-Analysis with Andrews-Kasy Estimators� by Sanghyun Hong, W. Robert Reed, Bifei Tian, Tingting Wu, and Gen Chen. 

The results are produced using Stata (Version 15) and R (Version 4.0.2). 




--------------------------------------------------------------

DATASET
- �data_sorted.csv�. These data are called by both the Stata and R programs

--------------------------------------------------------------

FILES NECESSARY TO REPRODUCE TABLES 3 AND 6, AND FIGURES 1-3:
- �StataDoFile� = .do file to reproduce Tables 3 and 6, and Figures 1-2

--------------------------------------------------------------

FILES NECESSARY TO REPRODUCE TABLES 4, 5, 7 AND 8:
- �Table 4.R� reproduces Table 4 in the paper.
- �Table 5.R� reproduces Table 5 in the paper.
- �Table 7.R� reproduces Table 7 in the paper.
- �Table 8.R� reproduces Table 8 in the paper.
- �AK_Estimators.R� defines the Andrews and Kasy estimators
- �data_sorted.csv� = .csv file called up by the R programs

Required R Packages:
- �metafor� is required to estimate Random and Fixed Meta-regression models
- �numDeriv� is used to compute a numerical approximation to the Hessian matrix of the Andrew and Kasy's maximum 
  likelihood functions at the optimal parameter values.

Instructions for running R programs:
- The function AK1Estimator(.) (or AK2Estimator(.)) takes an argument of the data in data frame format and 
  Estimates the symmetric (or asymmetric) Andrews and Kasy estimator.
- The dataset should have 'study id', 'estimated effect' (dependent variable), and 'standard errors corresponding 
  to the estimated effect', followed by moderator variables.
- For example, to estimate the FAT-PET Meta Regression, run:
  AKdata <- as.data.frame(cbind(id, effect=pcc, se=sepcc, constant=1, se=sepcc))
  AK1Estimator(AKdata)

The estimator 'AK1Estimator' returns estimation results including 
(i) the output from 'nlminb' optimizer,
(ii) Meta regression estimation results (i.e., coefficients, clustered standard error and p-value) and
(iii) some other statistics (i.e., log-likelihood, AIC and BIC).

--------------------------------------------------------------

In addition, the Excel spreadsheet "CodingData" contains the original coding sheet data.
The program �StataDataPrep� produces the .csv file, "data_sorted.csv", from this Excel file

--------------------------------------------------------------

Questions can be directed to the corresponding author, Bifei TIAN, tianbifei@zuel.edu.cn. 
